const uwJs = {


//判断险种是否不再指定的险种列表中，如果存在返回true，否则返回false
  judgeIsSpecCrtable: function (type_name, crtable) {
    //需要保费拆分的主险和附加险
    let INSTPREM_SPLIT_ALL_CRTABLE = "SUV3,SUV4,SUV5,SUV6,SUV7,UR04,UR05,URB3,URB4,SVT3,SVT4,SVT5,SVT6,SVT7,URT4,URT5,URTA,URTB";

//需要保费拆分的主险
    let INSTPREM_SPLIT_M_CRTABLE = "SUV3,SUV4,SUV5,SUV6,SUV7,UR04,UR05,URB3,URB4";

//需要保费拆分的附加险,此类险种也不允许加费
    let INSTPREM_SPLIT_R_CRTABLE = "SVT3,SVT4,SVT5,SVT6,SVT7,URT4,URT5,URTA,URTB";

//所有投连、万能险（含附加险）以及特殊险种：HRIB,ARSA,DICA,PNSA,PNSB,HRIC,WPIA,ARSB,WPIE,PNSC,DIAA,HRIA,WPIC,AVI1,DIBA
//保费计算时需要以传入的保费作为计算结果，以后可继续优化
//modify by JasonCui 20181021 S2018101105758-PIC_新趸缴万能年金营运系统需求 新增VSBL
//update by jiyongchang  PAS需求-S2019010206758-PIC_汇金资本F款营运系统需求（汇金资本F增加hardcode）20190116 start
    let INVEST_UNIVERSAL_ALL_CRTABLES = 'UR02,UR03,UR04,SUV1,SUV2,SVT2,URT3,URTP,URB2,SURT,URRT,URGT,UVGT,UVRT,UVA1,UVT2,UNV1,UNV2,USA1,USB1,USB2,USB3,USB4,USB5,USB6,USB7,USB8,IM0A,IM0B,IM0C,UIMA,UIMB,UIMC,DIAB,DIBB,DICB,WPIB,WPID,WPIF,VSB7,VSB8,VSB9,VSBA,VSBB,VSBC,VSBD,VSBE,VSBF,VSBH,VSBI,VSBJ,VSBK,VSBL,VSBM,HRIB,ARSA,DICA,PNSA,PNSB,HRIC,WPIA,ARSB,WPIE,PNSC,DIAA,HRIA,WPIC,AVI1,DIBA';
//add by jiyongchang 新产品附加今生倍护CDFS录入数字码显示产品代码有误  20191011 start
    INVEST_UNIVERSAL_ALL_CRTABLES = INVEST_UNIVERSAL_ALL_CRTABLES +",3RTA35,3RTA310,3RTA320,3RTA330,10RTA315,15RTA320,20RTA325,25RTA330,5RTA310,5RTA315,5RTA320,5RTA330";
//add by jiyongchang 新产品附加今生倍护CDFS录入数字码显示产品代码有误  20191011 end
//update by jiyongchang  PAS需求-S2019010206758-PIC_汇金资本F款营运系统需求（Z汇金资本F增加hardcode）20190116 end
//需要计算最高保额的险种
    let CAL_HISUMINS_CRTABLES = 'SUV1,SUV2,SUV3,SUV4,SUV5,SUV6,SUV7,SVT1,SVT2,SVT3,SVT4,SVT5,SVT6,SVT7,UR02,UR03,UR04,UR05,URT3,URT4,URT5,URTP,IM0A,IM0B,IM0C,IM2A,IM2B,IM2C,UIMA,UIMB,UIMC,UIMD,UIME,UIMF,URGT,URRT,URTP,URB1,URB2,UVGT,UVRT,UVT2,UNV1,UNV2,SURT,UR12,VRB1';

    //如果出入参数为空，直接返回
    if (type_name == null || type_name == "" || crtable == null || crtable == "") {
      return false;
    }
    //需要保费拆分的主险和附加险
    if (type_name == "INSTPREM_SPLIT_ALL_CRTABLE") {
      if (INSTPREM_SPLIT_ALL_CRTABLE.indexOf(crtable) >= 0) {
        return true;
      } else {
        return false;
      }
    }
    //需要保费拆分的主险
    if (type_name == "INSTPREM_SPLIT_M_CRTABLE") {
      if (INSTPREM_SPLIT_M_CRTABLE.indexOf(crtable) >= 0) {
        return true;
      } else {
        return false;
      }
    }
    //需要保费拆分的附加险
    if (type_name == "INSTPREM_SPLIT_R_CRTABLE") {
      if (INSTPREM_SPLIT_R_CRTABLE.indexOf(crtable) >= 0) {
        return true;
      } else {
        return false;
      }
    }

    //所有投连、万能险（含附加险）以及特殊险种：HRIB,ARSA,DICA,PNSA,PNSB,HRIC,WPIA,ARSB,WPIE,PNSC,DIAA,HRIA,WPIC,AVI1,DIBA
    if (type_name == "INVEST_UNIVERSAL_ALL_CRTABLES") {
      console.log("INVEST_UNIVERSAL_ALL_CRTABLES:"+INVEST_UNIVERSAL_ALL_CRTABLES);
      if (INVEST_UNIVERSAL_ALL_CRTABLES.indexOf(crtable) >= 0) {
        return true;
      } else {
        return false;
      }
    }

    //需要计算最高保额的险种
    if (type_name == "CAL_HISUMINS_CRTABLES") {
      if (CAL_HISUMINS_CRTABLES.indexOf(crtable) >= 0) {
        return true;
      } else {
        return false;
      }
    }
    return false;
  },

  //返回空格 size 返回的个数
  space: function (size) {
    let str = "";
    if (size <= 0) {
      return str;
    } else {
      for (var i = 0; i < size; i++) {
        str += " ";
      }
    }
    return str;
  },

  //时间
  showTime: function () {
    let dateTime = new Date();
    let year = dateTime.getFullYear();
    let month = dateTime.getMonth() + 1;
    let date = dateTime.getDate();
    let hours = dateTime.getHours();
    let minutes = dateTime.getMinutes();
    let seconds = dateTime.getSeconds();
    if (month < 10) {
      month = "0" + month;
    }
    if (date < 10) {
      date = "0" + date;
    }
    if (hours == 0 || hours < 10) {
      hours = "0" + hours;
    }
    if (minutes == 0 || minutes < 10) {
      minutes = "0" + minutes;
    }
    if (seconds == 0 || seconds < 10) {
      seconds = "0" + seconds;
    }
    let d = year + "" + month + "" + date + "" + hours + "" + minutes + "" + seconds;
    console.log(d)
    return d;
  }
}

export default uwJs;
